/**
 * Created by 张杰 on 2018/1/30.
 */
$(function (){
    var maxH=$(window).height();
    $(".main,.shadow").css({width:$(window).width()+"px",height:maxH+"px"});
    var obj=$(".shadow div");
    obj.css({width:$(window).width()/2+"px"});

    $(".shadow .heightCenter").css({height:maxH+"px"});
    var objName;
    $("input.default").click(function (){
        objName=$(this);
        $(".shadow").css("display","block");
        if(obj.height()>=maxH-50){
            obj.css({height:maxH-50+"px"});
            $(".shadow .heightCenter").css({"display":"none"});
        }else{
            obj.css({height:"auto"})
            $(".shadow .heightCenter").css({"display":"inline-block"});
        }
    });
    $(".shadow label input").click(function (){
        objName.val(this.parentNode.innerText);
        objName.next().val(this.value);
        $(".shadow")[0].style.display="none";
    });
});